package com.lili.vo;

import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.Data;

import java.util.Collections;
import java.util.List;

@Data
public class MyPage<T> {

    private long size = 10;

    /**
     * 当前页
     */
    private long current = 1;


    private List<T> records = Collections.emptyList();

    /**
     * 总数
     */
    private long total = 0;

    public MyPage() {

    }

    public MyPage(IPage<T> ipage) {
        this.current = ipage.getCurrent();
        this.records = ipage.getRecords();
        this.size = ipage.getSize();
        this.total = ipage.getTotal();
    }

}
